print("wenj")
f1 = open("test.txt", "r", encoding="utf-8")
print("文件内容是：", f1.read())
f1.close()
list2 = []
with open('test.txt', 'w', encoding='utf-8') as f1:
    f1.write("""itheima itcast python
itheima python itcast
beijing shanghai itheima
shenzhen guangzhou itheima
wuhan hangzhou itheima
zhengzhou bigdata itheima
""")
num2 = 0
with open('test.txt', 'r', encoding='utf-8') as f1:
    for line in f1:
        num3 = line.strip().split().count('itheima')
        num2 += num3
print("ithehima出现的次数是：", num2)
